<?php
declare(strict_types=1);

namespace App\Exception;

use App\Enum\Code;
use Hyperf\Server\Exception\ServerException;

class BusinessException extends ServerException
{
    public function __construct(public readonly Code $errCode, $message = 'Error', public readonly array $data = [], \Throwable $previous = null)
    {
        parent::__construct($message, $errCode->value, $previous);
    }
}